<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['order:orderplan:add']"
        >初始化数据</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { iniData } from "@/api/sm/index/index";

export default {
  name: "Orderplan",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 总部排产表格数据
      orderplanList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderId: null,
        productId: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        orderId: [
          { required: true, message: "订单ID不能为空", trigger: "blur" }
        ],
        productId: [
          { required: true, message: "产品ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
   
  },
  methods: {
   
    /** 新增按钮操作 */
    handleAdd() {
      this.loading = true;
      iniData().then(response => {
        this.loading = false;
        alert("初始化成功");
      });
    }
  }
};
</script>
